package com.xbk.seckill.stock.application.model.dto;

import com.xbk.seckill.common.model.dto.SeckillStockDTO;
import com.xbk.seckill.stock.domain.model.entity.SeckillStockBucket;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * 库存DTO
 *
 * @author xiexu
 * @date 2025/3/8 22:01
 */
public class SeckillStockBucketDTO extends SeckillStockDTO {

    private static final long serialVersionUID = 6707252274621460974L;

    /**
     * 分桶数量
     */
    private Integer bucketsQuantity;

    /**
     * 库存分桶信息
     */
    private List<SeckillStockBucket> buckets;

    public SeckillStockBucketDTO() {
    }

    public SeckillStockBucketDTO(Integer totalStock, Integer availableStock, List<SeckillStockBucket> buckets) {
        super(totalStock, availableStock);
        this.buckets = buckets;
        this.bucketsQuantity = buckets.size();
    }

    public List<SeckillStockBucket> getBuckets() {
        return buckets;
    }

    public void setBuckets(List<SeckillStockBucket> buckets) {
        this.buckets = buckets;
    }

    public Integer getBucketsQuantity() {
        return bucketsQuantity;
    }

    public void setBucketsQuantity(Integer bucketsQuantity) {
        this.bucketsQuantity = bucketsQuantity;
    }

}
